import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description: 数三角
 * User: DELL
 * Date: 2024-05-23
 * Time: 15:23
 */
public class Main5 {
    static class Node {
        int x;
        int y;

        public Node(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        Node[] nodes = new Node[n];
        for (int i = 0; i < n; i++) {
            int x = scanner.nextInt();
            int y = scanner.nextInt();
            nodes[i] = new Node(x, y);
        }
        long res = 0;
        long temp = 0;
        for (int i = 0; i < n; i++) {
            Node curNode = nodes[i];
            HashMap<Long, ArrayList<Node>> map = new HashMap<>();
            for (int j = 0; j < n; j++) {
                if (j == i) {
                    continue;
                }
                Node nextNode = nodes[j];
                if (map.containsKey(getLength(curNode, nextNode))) {
                    map.get(getLength(curNode, nextNode)).add(nextNode);
                } else {
                    ArrayList<Node> list = new ArrayList<>();
                    list.add(nextNode);
                    map.put(getLength(curNode, nextNode), list);
                }
            }
            // 遍历结果集
            for (ArrayList<Node> list : map.values()) {
                int size = list.size();
                if (size >= 2) {
                    for (int j = 0; j < size; j++) {
                        for (int k = j; k < size; k++) {
                            if (!isParallel(curNode, list.get(j), list.get(k))) {
                                // 判断是不是等边三角形，等边三角形会被算三次
                                // 本题不用考虑这个，因为直角坐标系整数点上组不出来等边三角形
                                if (getLength(curNode, list.get(j)) == getLength(list.get(j), list.get(k))) {
                                    temp++;
                                }
                                res++;
                            }
                        }
                    }
                }
            }
        }
        res -= (temp / 3 * 2);
        System.out.println(res);
    }

    private static long getLength(Node curNode, Node nextNode) {
        return (long) (curNode.x - nextNode.x) * (curNode.x - nextNode.x) + (long) (curNode.y - nextNode.y) * (curNode.y - nextNode.y);
    }

    private static boolean isParallel(Node curNode, Node nextNode1, Node nextNode2) {
        return (long) (nextNode1.x - curNode.x) * (nextNode2.y - curNode.y) == (long) (nextNode1.y - curNode.y) * (nextNode2.x - curNode.x);
    }
}
